<nz-modal [(nzVisible)]="isVisible"
          [nzWidth]="400" nzTitle="设备设置"
          (nzOnCancel)="handleCancel()"
          (nzOnOk)="handleOk()"
          [nzOkLoading]="isOkLoading"
          [nzFooter]="null"
          class="device-setting"
>
  <nz-spin [nzSpinning]="isSpinning">

    <div>
      <nz-form-item>
        <nz-form-label nzFor="name">波特率</nz-form-label>
        <nz-form-control>
          <nz-select [(ngModel)]="baudId" >
            <nz-option  *ngFor="let data of baudList let i =index" [nzLabel]="data.code" [nzValue]="data.id" nzLabel="5"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label nzFor="name">数据位</nz-form-label>
        <nz-form-control>
          <nz-select [(ngModel)]="dataBit" >
            <nz-option nzValue="5" nzLabel="5"></nz-option>
            <nz-option nzValue="6" nzLabel="6"></nz-option>
            <nz-option nzValue="7" nzLabel="7"></nz-option>
            <nz-option nzValue="8" nzLabel="8(默认)"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label nzFor="name">校验位</nz-form-label>
        <nz-form-control>
          <nz-select [(ngModel)]="parityBit" >
            <nz-option nzValue="0" nzLabel="None(默认)"></nz-option>
            <nz-option nzValue="1" nzLabel="Odd奇数"></nz-option>
            <nz-option nzValue="2" nzLabel="Even偶数"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label nzFor="name">停止位</nz-form-label>
        <nz-form-control>
          <nz-select [(ngModel)]="stopBit">
            <nz-option nzValue="0" nzLabel="1位(默认)"></nz-option>
            <nz-option nzValue="1" nzLabel="1.5位"></nz-option>
            <nz-option nzValue="2" nzLabel="2位"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label nzFor="name">脉冲功能开关</nz-form-label>
        <nz-form-control>
          <nz-switch [(ngModel)]="pulseSwitchState" nzCheckedChildren="开启" nzUnCheckedChildren="关闭"></nz-switch>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label nzFor="name">常开、常闭</nz-form-label>
        <nz-form-control>
          <nz-switch [(ngModel)]="level" nzCheckedChildren="常开" nzUnCheckedChildren="常闭"></nz-switch>
        </nz-form-control>
      </nz-form-item>
    </div>

    <div class="steps-action">
      <button nz-button nzType="primary" (click)="handleOk()">
        <span>确&nbsp;&nbsp;&nbsp;&nbsp;认</span>
      </button>
    </div>

  </nz-spin>
</nz-modal>
